beta_changesfandomcom-20200213-history
MS-DOS:1.25:SCP Cromemco OEM/MON.ASM
Changed file content As my laptop just turned off for no reason when I was finishing this, I am just pasting file segments here: Lines 1-14 (1-11 in 86-DOS 1.0) ; Seattle Computer Products 8086 Monitor version 1.5 6-10-82. ; by Tim Paterson ; This software is not copyrighted. ; To select a disk boot, set one of the following equates ; to 1, the rest to 0. SCP: EQU 0 ;1 for SCP, 0 for others. CROMEMCO4FDC: EQU 0 ;Cromemco 4FDC? CROMEMCO16FDC: EQU 0 ;Cromemco 16FDC? NORTHSTARSD: EQU 0 ;North Star single density? TARBELLSD: EQU 0 ;Tarbell SD controller or DD controller SD only TARBELLDD: EQU 1 ;Tarbell DD controller SD or DD? Lines 1404-1545 (1401-1471 in 86-DOS 1.0) ; ;************************************************ ; ; Boot for SCP, Cromemco 4FDC, or 16FDC disk controller with either ; large or small disks. Loads track 0, sector 1 into LOAD. ; IF SCP+CROMEMCO4FDC+CROMEMCO16FDC IF SCP DISK: EQU 0E0H ENDIF IF CROMEMCO4FDC+CROMEMCO16FDC DISK: EQU 30H MOV AL,0FFH ; Select side 0. OUTB 4 ENDIF IF SCP+CROMEMCO16FDC INB BASE+15 ; Get sense switch data. MOV CL,3 ; Shift bit 1 over to bit 4 so it ROL AL,CL ; can be used for large/small bit. AND AL,10H ; Keep only the large/small bit. ENDIF IF CROMEMCO16FDC OR AL,21H ; Add the rest of the drive-select bits. ENDIF IF SCP+CROMEMCO16FDC MOV BH,AL ; Put drive select byte in BH. ENDIF IF CROMEMCO4FDC MOV BH,21H ; Drive-select byte. ENDIF IF CROMEMCO16FDC MOV AL,30H ; Turn on disk motors and OUT DISK+4 ; wait one second. MOV CX,43716 MOTORDELAY: AAM ; 83 clocks. AAM ; 83 clocks. LOOP MOTORDELAY ; 17 clocks. ENDIF RETRY: MOV AL,0D0H ; Force-interrupt command. OUTB DISK MOV CX,5 DELAY: AAM ; Give force-interrupt time. LOOP DELAY IF SCP XOR BH,08H ; If SCP, flip density bit. ENDIF IF CROMEMCO16FDC XOR BH,40H ; If 16FDC, flip density bit. ENDIF IF CROMEMCO4FDC XOR BH,10H ; If 4FDC, flip disk size bit. ENDIF MOV AL,BH IF SCP OR AL,80H ; Turn on RESTORE for PerSci's. ENDIF OUTB DISK+4 MOV DI,LOAD MOV AL,0FH ; Restore command. OUTB DISK HOME: INB DISK+4 ; Wait for INTRQ. ROR AL JNC HOME IF SCP MOV AL,BH ; Turn RESTORE off. OUTB DISK+4 ENDIF INB DISK ; Read status. AND AL,98H JNZ RETRY ; Retry if bad. MOV AL,1 ; Ask for sector 1. OUTB DISK+2 IF CROMEMCO4FDC+CROMEMCO16FDC MOV AL,BH OR AL,80H ; Turn on auto-wait. OUTB DISK+4 ENDIF MOV DX,DISK+3 ; Disk controller data port. MOV AL,8CH ; Read command. OUTB DISK JMPS READ READLOOP: STOB ; Put data in memory. READ: IF SCP INB DISK+5 ; Wait for DQR or INTRQ. ENDIF IF CROMEMCO4FDC+CROMEMCO16FDC INB DISK+4 ENDIF ROR AL ; Check for INTRQ. INB DX ; Read data from disk controller chip. JNC READLOOP ; Jump if not. INB DISK ; Get status. AND AL,9CH JNZ RETRY ; Jump if error. ENDIF ; ;*************************************************** ; ; Boot for North Star disk, single density. ; Loads track 0, sector 0 into address LOAD ; IF NORTHSTARSD ; ; Disk command equates ; Lines 1563-1661 (1499-1593 in 86-DOS 1.0) MOV AL,SEC ; Reset sector flag. SECLP: TEST B,NOP,80H ; Wait for sector flag. JZ SECLP RET ONTRACK: MOV DI,LOAD MOV CX,280 MOV BX,RD+NOP GETSEC: CALL SECTOR TEST B,BST+NOP,0FH ; Test for sector zero. JNZ GETSEC GETSYNC: TEST B,NOP,4 LOOPZ GETSYNC JZ ONTRACK MOV CX,100H XOR DL,DL AAD READ: MOV AL,BX STOB ;Uses ES XOR DL,AL ROL DL AAD LOOP READ MOV AL,BX CMP AL,DL JNZ ONTRACK POP DS ENDIF ; ; ******************************************************************** ; ; Boot for Tarbell disk controllers. Load track 0, sector 1 into LOAD. ; IF TARBELLSD+TARBELLDD DISK: EQU 78H IF TARBELLDD SUB AH,AH ; Initial drive-select byte = 0. ENDIF JP RETRY DCOM: OUTB DISK MOV AL,50 HOLD: DEC AL JNZ HOLD RET RETRY: MOV AL,0D0H CALL DCOM READY: INB DISK ROR AL JC READY IF TARBELLDD XOR AH,08H ; Try other density. MOV AL,AH OUTB DISK+4 ENDIF MOV DI,LOAD MOV AL,0EH ; Home command @ 10ms/track CALL DCOM INB DISK+4 INB DISK AND AL,98H JNZ RETRY MOV AL,1 OUTB DISK+2 MOV DX,DISK+3 ; Disk controller data port. MOV AL,8CH CALL DCOM JMPS READ READLOOP: STOB ; Put in memory. READ: INB DISK+4 ; Wait for DRQ or INTRQ. ROL AL ; Check for INTRQ. INB DX ; Read data from disk controller chip. JC READLOOP ; Jump if not. INB DISK ; Read status. AND AL,9CH JNZ RETRY ENDIF ;*************************************************** IF OTHER ;User may insert customized disk boot here. All ;registers are available, stack pointer is valid ;and interrupts are enabled. Stack should be at